Telegram Group & Telegram Channel
⚡️ Фича дня: if consteval в C++23

Хотите разный код для compile-time и runtime? C++23 добавляет if consteval для условной компиляции!


🔴 До: Сложные трюки

template<typename T>
constexpr T compute() {
if (std::is_constant_evaluated()) {
return compile_time_version<T>();
}
return runtime_version<T>();
}



🟢 После: Читаемый consteval

template<typename T>
constexpr T compute() {
if consteval {
return compile_time_version<T>();
} else {
return runtime_version<T>();
}
}



❗️Практические применения:

• Оптимизированные математические библиотеки
• Compile-time криптография
• Генерация lookup-таблиц


💡Используете метапрограммирование в ваших проектах?

Библиотека C/C++ разработчика #буст
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/cppproglib/5782
Create:
Last Update:

⚡️ Фича дня: if consteval в C++23

Хотите разный код для compile-time и runtime? C++23 добавляет if consteval для условной компиляции!


🔴 До: Сложные трюки

template<typename T>
constexpr T compute() {
if (std::is_constant_evaluated()) {
return compile_time_version<T>();
}
return runtime_version<T>();
}



🟢 После: Читаемый consteval

template<typename T>
constexpr T compute() {
if consteval {
return compile_time_version<T>();
} else {
return runtime_version<T>();
}
}



❗️Практические применения:

• Оптимизированные математические библиотеки
• Compile-time криптография
• Генерация lookup-таблиц


💡Используете метапрограммирование в ваших проектах?

Библиотека C/C++ разработчика #буст

BY Библиотека C/C++ разработчика | cpp, boost, qt




Share with your friend now:
tg-me.com/cppproglib/5782

View MORE
Open in Telegram


Библиотека C C разработчика | cpp boost qt Telegram | DID YOU KNOW?

Date: |

The seemingly negative pandemic effects and resource/product shortages are encouraging and allowing organizations to innovate and change.The news of cash-rich organizations getting ready for the post-Covid growth economy is a sign of more than capital spending plans. Cash provides a cushion for risk-taking and a tool for growth.

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

Библиотека C C разработчика | cpp boost qt from it


Telegram Библиотека C/C++ разработчика | cpp, boost, qt
FROM USA